package org.dna.metronomo.persistence;

import java.util.List;

public interface IActivityDAO {
	/**
	 * Return the list of all activities registered on the DB.
	 * */
	List<Activity> allActivities() throws PersistenceException;
	
	/**
	 * Add a new activity
	 * */
	void addNewActivity(Activity activity) throws PersistenceException;
	
	/**
	 * Remove an activity using the instance as template
	 * */
	void deleteActivityByExample(Activity activity) throws PersistenceException;
	
	/**
	 * Removes an activity identified by the ID.
	 * */
	void deleteActivityByID(int id) throws PersistenceException;
	
	/**
	 * Return the activity identified by the ID, or null if not exists.
	 * */
	Activity queryActivityByID(int id) throws PersistenceException;
	
	/**
	 * Return the list of activities identified by the query, or empty list.
	 * */
	List<Activity> queryActivityByExample(Activity activity) throws PersistenceException;

	void update(Activity activity) throws PersistenceException;
	
	/**
	 * Adds the <code>job</code> to the specified <code>activity</code>
	 * */
	void addJobToActivity(Job job, Activity activity) throws PersistenceException;
	
	/**
	 * Update the persisted data for the job passed into.
	 * */
	void updateJob(Job job) throws PersistenceException;
}
